/*
day69_2
2019.11.5
*/ 

#include<stdlib.h>
#include<stdio.h> 
struct TreeNode{
	int val;
	struct TreeNode *left;
	struct TreeNode *right;
};


class Solution {
public:
	
	void help(struct TreeNode *root,struct TreeNode *&pre)
	{
		if(!root) return ;
		
		help(root->left,pre);
		
		pre->left=root;
		printf("%d\t%d\n",pre->val,root->val);
		pre=root;
		
		
		help(root->right,pre);
		
	}
   
   
    TreeNode* increasingBST(TreeNode* root) {
        struct TreeNode *tem=(struct TreeNode *)malloc(sizeof(struct TreeNode));
        tem->val=0;
		 
        help(root,tem);
        
//        struct TreeNode *cur=tem->left;
//        
//        while(cur)
//        {
//        	cur->left=cur->right;
//        	cur->right=NULL;
//        	cur=cur->left;
//		}
//      
		struct TreeNode *cur=tem->left ;
		return cur;
        
    }
};


int main()
{
	return 0;
}
